# class Employee:

#     def __init__(self,name,salary):
#         self.__name = name
#         self.__salary = salary


#     def get_salary(self):
#        return self.__salary

#     def set_salary(self,salary):
#         if 1000<salary<50000:
#            self.__salary = salary
#            print(self.__salary)
#         else:
#             print('录入错误！薪水不在1000-50000这个范围')

# e = Employee('tom',3500)
# print(e.get_salary())
# e.set_salary(-3300)
# e.set_salary(5500)

class Employee:

    def __init__(self,name,salary):
        self.__name = name
        self.__salary = salary

    @property
    def salary(self):
       return self.__salary

    @salary.setter
    def salary(self,salary):
        if 1000<salary<50000:
           self.__salary = salary
        else:
            print('录入错误！薪水不在1000-50000这个范围')

e = Employee('tom',3500)
print(e.salary)
e.salary = -2000
print(e.salary)
e.salary = 5500
print(e.salary)